Preserving Derivative Information while Transforming Neuronal Curves

The international neuroscience community is building the first comprehensive atlases of brain cell types to understand how the brain functions from a higher resolution, and more integrated perspective than ever before. In order to build these atlases, subsets of neurons (e.g. serotonergic neurons, prefrontal cortical neurons etc.) are traced in individual brain samples by placing points along dendrites and axons. Then, the traces are mapped to common coordinate systems by transforming the positions of their points, which neglects how the transformation bends the line segments in between. In this work, we apply the theory of jets to describe how to preserve derivatives of neuron traces up to any order. We provide a framework to compute possible error introduced by standard mapping methods, which involves the Jacobian of the mapping transformation. We show how our first order method improves mapping accuracy in both simulated and real neuron traces, though zeroth order mapping is generally adequate in our real data setting. Our method is freely available in our open-source Python package brainlit.

to define a curve c that agrees with this sampling, such as with a polynomial [13]. Then, we can apply ϕ to this curve, and compute the transformed positions and derivatives, defining the action on the finite sampling. Now, we verify the axioms of a group action.
First, the identity element (ϕ Id ) in the diffeomorphism group should leave a sampling unchanged. Assume that c is a curve that agrees with the sampling T : Second, a composition of diffeomorphisms (ϕ 1 • ϕ 2 ) should act successively on a sampling:

Proposition 1. [Zeroth Order
Mapping Error Bound 1] Say ϕ : R 3 → R 3 is a C 1 diffeomorphism and c : [0, L] → R 3 is a continuous, piecewise C 1 curve parameterized by arc length with knots {t i : For the transformed curve f = ϕ • c, the zeroth order mapping defines a first order spline g which satisfies: where δ ≜ max 2≤i≤n |t i − t i−1 |, and Dϕ • c(t) is the Jacobian of ϕ evaluated at c(t).
Proof. We will define the modulus of continuity for a function h : [t 0 , t n ] → R as in [11]: and note that ifḣ exists, then |ḣ| ≤ M implies ω(h; δ) ≤ M δ by the mean value theorem.
The theorem on spline function approximation in [11] states that the first order spline l that interpolates the function h : [t 0 , t n ] → R satisfies: Now consider the curve f = ϕ • c. First we will consider the curve restricted to the interval (t i , t i+1 ), denoted f i .
The derivative of f i exists everywhere and is equal to (Dϕ • c(t)) ·ċ(t), which is bounded by max t |Dϕ • c(t)| since |ċ(t)| = 1 (c is parameterized by arc length).
If we split the 3D curve f i into its coordinate functions Then for each f i,k , we can construct with a first order spline we are looking at a single segment. We can construct the full zeroth order mapping, g, by performing the same procedure over all segments indexed by i. We then maximize over all segments to get:

Proposition 2. [Zeroth Order Mapping Error Bound 2]
Say ϕ : R 3 → R 3 is a C 1 diffeomorphism and c : [0, L] → R 3 is a continuous, piecewise linear curve parameterized by arc length with knots {t i : For the transformed curve f = ϕ • c, the zeroth order mapping defines a first order spline g which satisfies: Proof. We will focus on a single line segment c i = c| [ti−1,ti] , then maximize over all such segments. c i is a function from [t i−1 , t i ] to R 3 . Denote the endpoints of c i as c i,0 = c i (t i−1 ) and c i,1 = c i (t i ). The zeroth order mapping of c i defines the first order spline g ci (t) = ϕ(c i,0 ) 0 )). For simplicity, we will reparameterize the problem using σ(t) The zeroth order mapping of c ′ defines the spline g c ′ (t) = ϕ(c i,0 ) + t(ϕ(c i,1 ) − ϕ(c i,0 )). Note that the zeroth order mapping errors are the same in both parameterizations i.e. for since, for every t ∈ [0, 1], |f c ′ (t) − g c ′ (t)| = |f ci (σ(t)) − g ci (σ(t))| and for every t ∈ [t i−1 , t i ], |f ci (t) − g ci (t)| = |f c ′ (σ −1 (t)) − g c ′ (σ −1 (t))|. So, we have converted the problem to bounding: and since f c ′ (t) − g c ′ (t) vanishes at both t = 0 and t = 1, the following argument, which uses the fundamental theorem of calculus, applies both going forward from t = 0 and backward from t = 1. So, without loss of generality, we consider 0 ≤ t ≤ 1 2 : where the last equality comes from the fact that c is parametrized by arc length, so |t i − t i−1 | = |c i,1 − c i,0 |. In summary we have: Finally, we maximize over all segments to get: where f = ϕ • c and g is the first order spline defined by the zeroth order mapping of c.

Proposition 3. [Comparable Bounds for Zeroth and First
Order Mapping] Say ϕ : R 3 → R 3 is a C 4 diffeomorphism and c : [a, b] → R 3 is a continuous, piecewise C 4 curve parameterized with knots {t i : t 1 = a, t n = b, t i−1 < t i } n i=1 . For the transformed curve f = ϕ • c defined by coordinate functions f = (f 0 , f 1 , f 2 ) T , the zeroth order mapping defines a first order spline g 0 which satisfies: is the k'th derivative of f j evaluated at t. Also, the first order mapping defines a third order spline g 1 , which satisfies and we note that the bound in 5 is tighter than the bound in 4. Further, there exists a transformed curve f and a set of knots {t i } n i=1 that achieves both bounds exactly.
Proof. We will prove both bounds starting with a single segment of c, then extending to the entire piecewise curve.
The bound in 5 comes from the error estimate of Hermite interpolation for one dimensional functions, Theorem 2 in Section 6.3 of [11]. For a single segment between knots t i−1 , t i , this theorem states that if p is the polynomial of degree at most 3 which agrees with h and ∂ t h at the knots, then, for each t, there exists a point ξ ∈ (t i−1 , t i ) such that: The first order mapping is indeed the third order spline that matches function and derivative values at the knots, so the above bound applies to all three coordinate functions of f = (f 0 , f 1 , f 2 ) T and g 1 = (g 0 1 , g 1 1 , g 2 1 ) T . To accommodate all three dimensions, we maximize over all dimensions and add a √ 3 term: Then if we maximize both sides over all the segments, we get The bound in 4 comes from the error estimate of polynomial interpolation, Theorem 2 in Section 6.1 of [11]. This theorem states that, for a single segment between knots t i−1 , t i , if p is the line that agrees with a one dimensional function h at the knots, then there exists a point ξ ∈ (t i−1 , t i ) such that: Our remaining task is to relate the maximum second derivative to the maximum fourth derivative. We start by using the fundamental theorem of calculus twice to get (for t ∈ [t i−1 , t i ]):